<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:h="http://java.sun.com/jsf/html">

    <div class="ui-g">
        <div class="ui-g-12"><h3><b>甲方基础信息</b></h3></div>
        <div class="ui-g-2">
            <p:outputLabel for="name" value="甲方产品名称"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="name" value="#{firstPartyTagInfoBean.$.name}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="approvalType" value="审核方式"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="approvalType" value="#{firstPartyTagInfoBean.$.approvalType}"
                             filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.APPROVAL_TYPE]}" var="dic"
                               itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="promotionType" value="推广模式"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="promotionType"
                             value="#{firstPartyTagInfoBean.$.promotionType}" filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.PROMOTION_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2">
            <p:outputLabel value="甲方营业执照"/>
        </div>
        <div class="ui-g-1">
            <p:graphicImage url="#{firstPartyTagInfoBean.$.businessLicense}" width="80"/>
        </div>
        <div class="ui-g-3">
            <p:fileUpload fileUploadListener="#{firstPartyTagInfoBean.onUploadBusinessLicense}"
                          mode="advanced"
                          fileLimit="1"
                          auto="true"
                          fileLimitMessage="只能上传一个文件"
                          invalidFileMessage="不支持上传文件类型"
                          invalidSizeMessage="文件过大"
                          sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                          allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/"
                          label="上传" update="@form" process="@form" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        
        <div class="ui-g-2">
            <p:outputLabel for="company" value="甲方公司名称"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="company" value="#{firstPartyTagInfoBean.$.companyId}"
                             filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.companyList}" var="company"
                               itemLabel="#{company.companyName}" itemValue="#{company.id}"/>
            </p:selectOneMenu>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="dayLimitClickUv" value="每日上限控量"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="dayLimitClickUv" value="#{firstPartyTagInfoBean.$.dayLimitClickUv}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="everyDayOnlineTime" value="每天上线时间"/>
        </div>
        <div class="ui-g-4">
            <p:calendar id="everyDayOnlineTime" value="#{firstPartyTagInfoBean.$.everyDayOnlineTime}"
                        locale="#{constants:get('LOCALE')}"
                        timeZone="#{constants:get('TIME_ZONE')}"
                        pattern="HH:mm"
                        timeOnly="true" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2" >
            <p:outputLabel for="everyDayOfflineTime" value="每天下线时间"/>
        </div>
        <div class="ui-g-4">
            <p:calendar id="everyDayOfflineTime" value="#{firstPartyTagInfoBean.$.everyDayOfflineTime}"
                        locale="#{constants:get('LOCALE')}"
                        timeZone="#{constants:get('TIME_ZONE')}"
                        pattern="HH:mm"
                        timeOnly="true" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
        <p:outputLabel for="cooperativeOrganization" value="合作机构" />
        </div>
        <div class="ui-g-4">
            <p:inputText id="cooperativeOrganization" value="#{firstPartyTagInfoBean.$.cooperativeOrganization}"
                         disabled="#{firstPartyTagInfoBean.isView()}" />
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="partnerAgreement" value="甲方注册协议" />
        </div>
        <div class="ui-g-4">
            <p:inputText id="partnerAgreement" value="#{firstPartyTagInfoBean.$.partnerAgreement}"
                         disabled="#{firstPartyTagInfoBean.isView()}" />
        </div>


        <div class="ui-g-2">
            <p:outputLabel for="productType" value="甲方类型" />
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="productType" value="#{firstPartyTagInfoBean.$.productType}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                <p:ajax event="change" process="@form" update="@form"/>
                <f:selectItems
                        value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.LOAN_PRODUCT_TYPE]}"
                        var="dic"
                        itemLabel="#{dic.name}"
                        itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>

       <!--<div class="ui-g-2"><p:outputLabel value="是否加入替补池"/></div>-->
        <!--<div class="ui-g-4">-->
            <!--<p:selectOneRadio id="isAddReplace" value="#{firstPartyTagInfoBean.$.isAddReplace}"-->
                              <!--disabled="#{firstPartyTagInfoBean.isView()}">-->
                <!--<f:selectItem itemLabel="是" itemValue="1" />-->
                <!--<f:selectItem itemLabel="否" itemValue="0" />-->
            <!--</p:selectOneRadio>-->
        <!--</div>-->

        
        <div class="ui-g-12">
            <h3><b>甲方贷款类型</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanType}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.FIRST_PARTY_LOAN_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>用户身份标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.identity}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.IDENTITY_TAG]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>信用卡标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.credit}" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.CREDIT_CARD_TAG]}" var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>

        <div class="ui-g-12"><h3><b>借款基础信息</b></h3></div>
        <div class="ui-g-2"><p:outputLabel for="rateType" value="利率模式"/></div>
        <div class="ui-g-4">
            <p:selectOneMenu id="rateType" value="#{firstPartyTagInfoBean.$.rateType}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <p:ajax event="change" process="@form" update="@form"/>
                <f:selectItems
                        value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.RATE_TYPE]}"
                        var="dic"
                        itemLabel="#{dic.name}"
                        itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2"><p:outputLabel for="loanSpeed" value="最快放款时间"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="loanSpeed" value="#{firstPartyTagInfoBean.$.loanSpeed}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">天</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minLimit" value="最低借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="minLimit" value="#{firstPartyTagInfoBean.$.minLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxLimit" value="最高借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="maxLimit" value="#{firstPartyTagInfoBean.$.maxLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="defaultAmount" value="默认借款额度"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="defaultAmount" value="#{firstPartyTagInfoBean.$.defaultAmount}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">
                    <h:outputText value="元"/>
                </span>
            </div>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="defaultTime" value="默认借款期限"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="defaultTime" value="#{firstPartyTagInfoBean.$.defaultTime}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minTerm" value="最短借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="minTerm" value="#{firstPartyTagInfoBean.$.minTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxTerm" value="最长借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="maxTerm" value="#{firstPartyTagInfoBean.$.maxTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="averagePrice" value="件均价"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="averagePrice" value="#{firstPartyTagInfoBean.$.averagePrice}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="repayType" value="还款方式"/></div>
        <div class="ui-g-4">
            <p:selectOneRadio id="repayType" value="#{firstPartyTagInfoBean.$.repayType}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.LOAN_PRODUCT_REPAY_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectOneRadio>
        </div>
        <div class="ui-g-12">
            <h3><b>借款所需资料</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanNecessaryData}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.LOAN_NECESSARY_DATA]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>

    </div>
</ui:composition>




